PRG 1.0 TXT

/*
*/

//-----------------------------------------------------------------------------
// [CONFIG]

include "..\program_include.ocf"

object Program
{
	type		= e_program.DEPTH_AT;
	layer_bits	= e_render_layer_bits.DEPTH;

	textures	= array /*ProgramTexture*/ {
		{ "unDiffuseMap", e_texture.DIFFUSE }
	}
	
	uniforms	= array /*string*/ {
		"transform", "unTransform."
	}
}


//-----------------------------------------------------------------------------
// [VERTEX]

#version 330 core
#pragma optimize(on)

#define ATTR_POSITION	0
#define ATTR_TEXCOORD	2

layout(location = ATTR_POSITION) in vec3  inPosition;
layout(location = ATTR_TEXCOORD) in vec2  inTexcoord;

uniform struct TTransform {
	mat4	MVP;
} unTransform;

out	TVertexData {
	vec2	vTexcoord;
} Output;


void main()
{
	gl_Position		 = unTransform.MVP * vec4(inPosition, 1.0);
	Output.vTexcoord = inTexcoord;
}


//-----------------------------------------------------------------------------
// [FRAGMENT]

#version 330 core
#pragma optimize(on)

#define ALPHA_REF	0.1

uniform sampler2D	unDiffuseMap;

in	TVertexData {
	vec2	vTexcoord;
} Input;


void main()
{
	vec4	color = texture( unDiffuseMap, Input.vTexcoord );
	
	if ( color.a < ALPHA_REF )
		discard;
}

// [END]
